<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

<script src="/public/static/js/jquery-3.31.min.js"></script>
<script>
    var hive_token = getQueryString('hive_token');
    var hive_site = getQueryString('hive_site');
    $(document).ready(function() {
        $.ajax({
            url: '/system/Login/hiveLogin',
            type: 'post',
            data:{
                hive_token: hive_token,
                hive_site: hive_site,
            },
            cache: false,  //禁用缓存
            dataType: 'json',
            success: function (data) {
                if (data.code==200){
                    window.localStorage.setItem('token',data.data.token);
                    window.localStorage.setItem('user_info',JSON.stringify(data.data.user_info));
                    window.localStorage.setItem('userInfo',JSON.stringify(data.data.user_info));
                    window.localStorage.setItem('userData',JSON.stringify(data.data));
                    window.localStorage.setItem('privilege',JSON.stringify(data.data.privilege));
                    window.localStorage.setItem('isAwaysLogin',1);
                    window.sessionStorage.setItem('isClickLogin',1);
                    window.sessionStorage.setItem('istoactiveKey',1);
                    setTimeout(function () {
                        window.location.href = '/'
                    },500);
                }
            },
            error:function(){

            }
        });
    });
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]);
        return null;
    }
</script>
</body>
</html>